FUNCTION

error

pure function error([message: text]): error_type

Unconditionally fail, raising an exception, with an optional message.

Ends control flow, enabling one to write e.g.

function f(x: integer?): integer {
    if (x == null) {
        rell.error('null argument');
    }
    return x * x; // compiler knows that x cannot be null, so we can write x * x
}

rell.error(message) is equivalent to require(false, message), except that rell.error() has the additional end-of-control-flow behaviour.

Parameters

  • message — the message for the exception to be thrown

Throws

  • exception — unconditionally

Since

0.14.15

© 2026 Chromia